-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify Channel constructors, change kwargs to positional args. #32818
Conversation
Oops, fixes this error, introduced in e891bca: WARNING: Method definition (::Type{Base.Channel{T}})(Function) where {T} in module Base at channels.jl:133 overwritten at channels.jl:136.
"Soft" deprecation of the old `Channel(f::Function; csize=0, ctype=Any)` style in favor of the new `Channel{T=Any}(f::Function, size=0)` interface. Removed the old interface from the docs, so that it is not discoverable, and included a `!!! compat` note that the new interface is new in Julia 1.3, and the old interface should not be used.
d042f3b
to
b04fb84
Compare
Okay, this should be good to go! :) Thanks again for the review. I think I will open one more PR for adding the |
Looks good. I think this is missing a |
Aye, so it is. :) Thanks good catch! (I was about to fix it by pushing |
Either seems fine to me. |
EDIT: |
Okay thanks! :) Done! |
@@ -8,9 +8,9 @@ Representation of a channel passing objects of type `T`. | |||
abstract type AbstractChannel{T} end | |||
|
|||
""" | |||
Channel{T}(sz::Int=0) | |||
Channel{T=Any}(size::Int=0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow... maybe we should actually implement this syntax for defining constructors with default type parameter values? Seems quite possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow... maybe we should actually implement this syntax for defining constructors with default type parameter values? Seems quite possible.
:D Yeah that makes sense to me! It seems pretty readable, and has an intuitive meaning, i think.
Oops, fixes this error, introduced in #30855: